<?php

namespace plugin\admin\app\model;

use plugin\admin\app\model\Base;

/**
 * @property integer $id (主键)
 * @property integer $user_id 用户ID
 * @property string $name 名称
 * @property string $author 作家
 * @property string $thumb 封面
 * @property integer $type 类型1图片集,2pdf
 * @property string $pdf pdf
 * @property string $images 图片集
 * @property string $created_time 创建时间
 */
class Music extends Base
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'wa_musics';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';
    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    const TYPE_PDF = 1;

    const TYPE_IMAGES = 2;

    const TYPE_TEXT = [
        self::TYPE_PDF => 'pdf',
        self::TYPE_IMAGES => '图片'
    ];

    public static function getTypeText($type)
    {
        return self::TYPE_TEXT[$type] ?? '';
    }
    
}
